package com.lxd.bitmap.task;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;

import com.lxd.com.R;

public class BitmapAdapter extends BaseAdapter {

	LayoutInflater mInflater;
	private Context mContext;
	public BitmapAdapter(Context context){
		mContext = context;
		mInflater = LayoutInflater.from(context);
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 1;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		convertView = mInflater.inflate(R.layout.image_and_text_row, null);
		ImageButton button = (ImageButton)convertView.findViewById(R.id.imagebtn);
		BitmapLoadAsyncTask task = new BitmapLoadAsyncTask(mContext, button);
		task.execute("http://sbnnest.com/picture/1.jpg");
		return convertView;
	}

}
